package com.trxy.controller.front;


import com.trxy.model.Product;
import com.trxy.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
@RequestMapping("/front/browse")
public class BrowseController {
    @Autowired
    ProductService productService;

    /**
     * 商品列表
     */
    @RequestMapping("/product/list")
    String productList(Model model) {
        List<Product> products = productService.selectAll();
        model.addAttribute("PRODUCTS", products);
        return "front/product/list";
    }
}
